/**
 * 
 */
package optimization.naturalOptimization.evolutionaryAlgorithm.evolutionaryOperator.evaluator;

import optimization.naturalOptimization.evolutionaryAlgorithm.EvolutionaryAlgorithm;
import optimization.naturalOptimization.evolutionaryAlgorithm.evolutionaryOperator.EvolutionaryOperator;

/**
 * This class provides an evaluator for an evolutionary algorithm.
 * 
 * @author Kevin Wagner
 * @version 1.0
 */
public class StandardEvaluator extends EvolutionaryOperator {

	/**
	 * Creates a new evaluator to perform a fitness check.
	 * 
	 * @param parentEA
	 *            parent evolutionary algorithm
	 */
	public StandardEvaluator(EvolutionaryAlgorithm parentEA) {
		super(parentEA);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * optimization.naturalOptimization.evolutionaryAlgorithm.evolutionaryOperator
	 * .EvolutionaryOperator#work()
	 */
	@Override
	public void work() {
		try {
			getParentEA().getFitness().getFitness(
					getParentEA().getProgenyPopulation());
		} catch (Exception e) {
			getParentEA().pushError(e);
		}

	}

}
